{% extends '__base.tpl' %}

{% block head %}
<title>编程达人 {{data.name}}</title>
<meta name="keywords" content="编程达人书籍,{{data.name}},作者,{{data.author}}" />
<meta name="description" content="{{data.intro|toDescription}}"/>
<!-- build:css -->
    <link rel="stylesheet" type="text/css" href="../../../public/css/page/popup.css" />
    <link rel="stylesheet" type="text/css" href="../../../public/css/page/contentPage.css" />
<!-- endbuild -->
{% endblock %}

{% block body %}
<div id="box" data-comment_type="2" >
    <div class="contentHead relative">
        <div style="width: 500px;" class="fleft center">
            <div class="slide-wrap book-slide" id="banner">
                <ul class="img-wrap" id="bannerIMG">
                    {%for item in data.covers%}
                    <li>
                        <a target="_blank" href="javascript:;">
                            <img height="280px" src="{{item|imgPath}}">
                        </a>
                    </li>
                    {%endfor%}
                </ul>
                <div class="book-circle-wrap">
                 <!--   <a href="javascript:;" class="book-prev" onclick="BASE.OTHER_BUYBOOK.BANNER.prev()"></a>-->
                    <ol class="book-circle">
                        {%for item in data.covers%}
                        <li>
                            <a href="javascript:;">
                                <img src="{{item|imgPath}}">
                            </a>
                        </li>
                        {%endfor%}
                    </ol>
                <!--    <a href="javascript:;" class="book-next" onclick="BASE.OTHER_BUYBOOK.BANNER.next()"></a>-->
                </div>
                <a target="_blank" href="{{data.pdfFile|imgPath}}" class="read-book"></a>
            </div>
          <!--  <img height="280px" src="{{data.covers|imgPath}}">-->
        </div>
        <span style="padding-top: 50px">
            <h2 class="title">{{data.name}}</h2>
            <small class="sub-title mt10">
                作者：{{data.author}}著
            </small>
            <p class="mt20">
                 <small class="sub-title">
                 库存：{{data.stock}}{% if data.stock <0%}预售{%endif%}
                 &nbsp; &nbsp; &nbsp; &nbsp;销量：{{data.buyCount}}
                </small>
            </p>

        </span>
        <div class="font16 absolute" style="right: 15px;">
            书籍评分：
            <em class="red">
                {% if data.scoreCount%}
                {{(data.scoreTotal/data.scoreCount)|toFloat(1)}}
                {%else%}
                10
                {%endif%}
            </em>
        </div>
        <span style="padding:80px 20px 20px;">
            <div>
                <b class="vmiddle">价格：</b>
                <em class="color-warning vsub">¥ {{data.price}}</em>
               <!-- <i class="font13 fontn clo6 vmiddle">
                    （库存：{{data.stock}}{% if data.stock <0%}预售{%endif%}
                    销量：{{data.buyCount}}）
                </i>-->
            </div>
            <div class="car-btn-box mt15 mb20">
                 <b class="vmiddle">数量：</b>
                   <button class="car-add-btn" onclick="BASE.OTHER_BUYBOOK.addReduceNum(-1)">－</button>
                   <i class="orange font15 fontn" id="buyNumber">1</i>
                   <button class="car-reduce-btn" onclick="BASE.OTHER_BUYBOOK.addReduceNum(1)">＋</button>
                   <button class="btnBlueM ml30" onclick="BASE.OTHER_BUYBOOK.sureBuyPre(this)">立即购买</button>
                   <a target="_blank" href="{{data.pdfFile|imgPath}}" class="blue u ml30">pdf样章下载</a>
            </div>
        </span>
    </div>

    <div>
        <div class="lmessageB tabs-nav">
            <span class="lmText">书籍介绍</span>
            <span onclick="BASE.COMMON.getCommentScore.call(this,1)">评价
                {%if data.scoreCount %}
                ({{data.scoreCount}})
                {%endif%}
            </span>
        </div>
        <div class="tabs-con" style="height: auto">
            <!--介绍-->
            <div class="tabs1" style="display: block;">
                <ul class="video-profile vue-editor">
                    {% if data.intro %}
                    <li class="mb30">
                        {{data.intro|safe}}
                    </li>
                    {% else %}
                    <li class="mb30">
                        {% include '__no_data.html' %}
                    </li>
                    {% endif %}
                </ul>
            </div>
            <!--评价-->
            <div class="tabs3 lmessageC" style="display: none;">
                <!--评论-->
                <div id="commentScore">
                    <div class="btnStar-box">
                        <div class="btnStar">
                            通俗易懂
                            {% include '__starScore.html' %}
                        </div>
                        <div class="btnStar">
                            知识连贯
                            {% include '__starScore.html' %}
                        </div>
                        <div class="btnStar">
                            文笔流畅
                            {% include '__starScore.html' %}
                        </div>
                        <div class="btnStar">
                            图文并茂
                            {% include '__starScore.html' %}
                        </div>
                        <div class="btnStar">
                            讲解透彻
                            {% include '__starScore.html' %}
                        </div>
                    </div>
                </div>
                <div class="mb10">
                    <textarea placeholder="写下你的评论..." maxlength="200" id="comment_content"></textarea>
                    <button class="btnBlueM fright mr10" onclick="BASE.COMMON.addCommentScore(this)">发送</button>
                </div>
                {% include '__comment_score_list.html' %}
                {% include '__page.html' %}
            </div>
        </div>
    </div>
</div>
{% endblock %}
{% block script %}
    {{ super() }}
<!-- build:js -->
    <script src="../../../public/js/page/plugin/banner.js"></script>
    <script src="../../../public/js/page/plugin/nativepage.js"></script>
    <script src="../../../public/js/page/other/other_buyBook.js"></script>
<!-- endbuild -->
    <script>
        $(function () {
            BASE.OTHER_BUYBOOK.BANNER = bannerSlide('banner');
        })
    </script>
{% endblock %}